const mongoose = require("mongoose");

const shoppingSchema = mongoose.Schema({
    username: {
      type: String,
      require: true,
    },
    cartName: {
      type: String,
      require: true,
    },
    cartDes: { //商品描述
      type: String,
      require: [true, '描述'],
    },
    cartImg: { //图片路径
      type: String,
      require: [true, '图片路径'],
    },
    cartType: { //商品类型
      type: String,
      require: true,
    },
    cartPrice: {//价格
      type: Number,
      require: true,
    },
    cartSpc: { //规格
      type: String,
      require: true,
    },
    cartNum: { //数量
        type: Number,
        require: true,
    }
  });
  
  module.exports = mongoose.model("addCart", shoppingSchema);